<?php namespace Common\Model;
use Hdphp\Model\Model;

class Addaddress extends Model{
    protected $table='receipt';
    protected $validate=[
        ['province','required','省是必选项',3,3],
        ['city','required','市是必选项',3,3],
        ['xian','required','县是必选项',3,3],
        ['rename','required','收货人姓名必填',3,3],
        ['rephone','required','收货人手机号必填',3,3],
        ['rephone','phone','收货人手机号有误',3,3],
    ];
//    地址添加
    public function store(){
        if(!$this->create()) return false;
        $this->data['shop_user_uid']=$_SESSION['userinfo']['uid'];
        $this->data['rephone']=Q('post.rephone');
        $this->add();
        return true;
    }
//    地址编辑
    public function edit(){
//        p(Q('post.'));die;
        if(!$this->create()) return false;
        $this->save();
        return true;
    }

}